package com.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.web.main.entity.vo.PileVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 王鑫
 * @create 2020 -11 -23 15:33
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("订单对象")
@TableName(value = "orders")
public class Orders implements Serializable {
    private static final long serialVersionUID = -7252405721188063L;
    @ApiModelProperty(value = "主键")
    @TableId(value = "orders_id", type = IdType.ID_WORKER_STR)
    private String ordersId;

    @ApiModelProperty(value = "用户对象")
    @TableField(exist = false)
    private User user;

    @ApiModelProperty(value = "充电桩对象")
    @TableField(exist = false)
    private PileVo pile;

    @ApiModelProperty(value = "用户id")
    @TableField("user_id")
    private String userId;

    @ApiModelProperty(value = "充电桩id")
    @TableField("pile_id")
    private String pileId;

    @ApiModelProperty(value = "充电费（单价xx元/度）")
    @TableField("orders_pile_recharge_money")
    private Double ordersPileRechargeMoney;

    @ApiModelProperty(value = "服务费（单价xx元/度）")
    @TableField("orders_pile_serve_money")
    private Double ordersPileServeMoney;

    @ApiModelProperty(value = "停车费（固定xx元）")
    @TableField("orders_pile_park_money")
    private Double ordersPileParkMoney;

    @ApiModelProperty(value = "占用充电桩费用（单价xx元/分钟）")
    @TableField("orders_pile_occupy_monty")
    private Double ordersPileOccupyMonty;

    @ApiModelProperty(value = "支付方式（0：微信:1：支付宝）")
    @TableField("orders_pile_payment")
    private Integer ordersPilePayment;

    @ApiModelProperty(value = "充电开始时间")
    @TableField("orders_start_time")
    private String ordersStartTime;

    @ApiModelProperty(value = "充电结束时间")
    @TableField("orders_end_time")
    private String ordersEndTime;

    @ApiModelProperty(value = "占用充电桩结束时间")
    @TableField("orders_out_time")
    private String ordersOutTime;

    @ApiModelProperty(value = "总费用")
    @TableField("orders_bigDecimal")
    private Double ordersBigDecimal;

    @ApiModelProperty(value = "状态（0：已支付、1:删除）")
    @TableField("orders_state")
    @TableLogic
    private Integer ordersState;

    @ApiModelProperty(value = "版本号，用于乐观锁")
    @TableField("orders_version")
    @Version
    private Integer ordersVersion;

    @ApiModelProperty(value = "订单创建时间")
    @TableField(value = "orders_create_time", fill = FieldFill.INSERT)
    private Date ordersCreateTime;

    @ApiModelProperty(value = "订单修改时间")
    @TableField(value = "orders_modify_time", fill = FieldFill.INSERT_UPDATE)
    private Date ordersModifyTime;
}
